#include "GowildSearchCmd.h"

GowildSearchCmd::GowildSearchCmd(QObject *parent) :
    BaseCmd(parent)
{
    this->m_protocolType = ProtocolType::GowildProtocol;
    this->m_functionCode = FunctionCode;
}
Package GowildSearchCmd::toPackage()
{
    Package package;

    QVariantMap jsonData;
    jsonData.insert("type","RESPONSE_TCP");

    QVariantMap data;
    data.insert("ip",m_ip);
    data.insert("port",m_port);
    data.insert("company",m_company);

    jsonData.insert("data",data);

    QJson::Serializer serializer;
    QByteArray body = serializer.serialize(jsonData, NULL);

    package.setBody(body);
    package.setFunction(FunctionCode);

    return package;

}

void GowildSearchCmd::unPackage(Package package)
{
    Q_UNUSED(package);
}
QString GowildSearchCmd::ip() const
{
    return m_ip;
}

void GowildSearchCmd::setIp(const QString &ip)
{
    m_ip = ip;
}
quint16 GowildSearchCmd::port() const
{
    return m_port;
}

void GowildSearchCmd::setPort(const quint16 &port)
{
    m_port = port;
}
QString GowildSearchCmd::company() const
{
    return m_company;
}

void GowildSearchCmd::setCompany(const QString &company)
{
    m_company = company;
}



